<template>
  <div class="m-index">
    <!-- 首页楼层内容 -->
    <div class="m-index-floor">
      <!-- banner -->
      <div class="m-banner-bar">
        <div class="m-app-container login-bar clearfix">
          <div class="login fr">
            <p class="title">投融宝</p>
            <p class="small-title">预期年化收益率</p>
            <p class="info">6~8<span style="font-size: 36px;">%</span></p>
            <div>
              <w-button type="shaow" @on-click="$router.push('/register')">免费注册</w-button>
            </div>
            <p class="tip">已有账号？<span class="c-main" @click="$router.push('/login')">立即登录</span></p>
          </div>
        </div>
      </div>
      <!-- 首页主体 -->
      <div class="m-index-content">
        <div class="m-app-container">
          <!-- 三个广告 -->
          <div class="adv-c">
            <div class="adv-list">
              <div class="adv-item">
                <div class="clearfix item">
                  <div class="fl icon">
                    <img src="../assets/guozi.png" alt="">
                  </div>
                  <div class="mrl">
                    <p class="title">国资参股</p>
                    <p>政府引导，统一监管 民间资本市场规范化</p>
                  </div>
                </div>
              </div>
              <div class="adv-item">
                <div class="clearfix item">
                  <div class="fl icon">
                    <img src="../assets/zhuangye.png" alt=""></div>
                  <div class="mrl">
                    <p class="title">国资参股</p>
                    <p>资深金融团队运营 风险防控体系完善</p>
                  </div>
                </div>
              </div>
              <div class="adv-item">
                <div class="clearfix item">
                  <div class="fl icon">
                    <img src="../assets/yinhang.png" alt=""></div>
                  <div class="mrl">
                    <p class="title">国资参股</p>
                    <p>用户资金专户存管 与平台账户相隔离</p>
                  </div>  
                </div>
              </div>
            </div>
          </div>

          <!-- 投保专区 -->
          <div class="products-area">
            <div class="p-l">
              <div class="p-l-c">
                <span class="title">投融宝专区</span>
                <p>轻松理财，乐享收益</p>
                <div class="more">
                  <w-button type="shaow" @on-click="$router.push('proarea')">查看更多</w-button>
                </div>
                <div class="tips">
                  <div class="tip icon-money">
                    <span style="padding-left: 20px;">权益丰厚，高效省心</span>
                  </div>
                  <br>
                  <div class="tip icon-msg">
                    <span style="padding-left: 20px;">风控严谨、审核详尽</span>
                  </div>
                </div>
              </div>
            </div>
            <div class="p-r">
              <div style="padding: 0 40px;">
                <div class="p-item" v-for="(item, index) in 3" :key="index">
                  <p>投融宝-FXZQ20180374</p>
                  <div class="info">
                    <div class="info-i" style="width: 18%">
                      <span class="info-msg money">8.6<span class="fonts">%</span></span>
                      <br>
                      <span class="info-tip">预期年化收益率</span>
                    </div>
                    <div class="info-i" style="width: 18%">
                      <span class="info-msg">365<span class="fonts">天</span></span>
                      <br>
                      <span class="info-tip">产品期限</span>
                    </div>
                    <div class="info-i" style="width: 22%">
                      <span class="info-msg">8,000<span class="fonts">元</span></span>
                      <br>
                      <span class="info-tip">标的总额</span>
                    </div>
                    <div class="info-i" style="width: 26%">
                      <div class="proce">
                        <w-progress :height="8" :percentage="30"></w-progress>
                      </div>
                      <br>
                      <span class="info-tip">剩余可投78,000元</span>
                    </div>
                    <div class="info-i" style="width: 14%">
                      <w-button type="main" @on-click="jumpProDetail">投资</w-button>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>

          <!-- 合作机构 -->
          <div class="compony-list">
            <div class="nav-title">
              <span>合作机构</span>
            </div>
            <div class="componys">
              <div class="c-item">
                <div>
                  <img src="../assets/compony1.png" alt="">
                </div>
              </div>
              <div class="c-item">
                <div>
                  <img src="../assets/compony2.png" alt="">
                </div>
              </div>
              <div class="c-item">
                <div>
                  <img src="../assets/compony3.png" alt="">
                </div>
              </div>
              <div class="c-item">
                <div>
                  <img src="../assets/compony4.png" alt="">
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {}
  },
  methods: {
    /**
     * 跳转投资产品详情
     */
    jumpProDetail() {
      window.open('/product')
    }
  }
}
</script>

<style lang="scss">
.m-index-floor {
  .m-banner-bar {
    .btn {
      width: 100%;
      height: 48px;
    }
  }
  .products-area {
    .btn {
      width: 100%;
      height: 48px;
    }
  }
}
</style>

<style lang="scss" scoped>
@import '../scss/_var.scss';
.m-index-floor {
  width: 100%;
}
.m-banner-bar {
  position: relative;
  width: 100%;
  height: 520px;
  background: url(../assets/banner.png) no-repeat;
  background-size: cover;
  .login-bar {
    top: calc(100% - 440px);
    position: absolute;
    left: 0;
    margin: 0 auto;
    right: 0;
    .login {
      width:340px;
      height:360px;
      background-color: $color-white;
      padding: 36px 40px;
      text-align: center;
      .title {
        font-size:24px;
        font-weight:500;
        color:rgba(254,76,54,1);
        line-height:33px;
        text-shadow:0px 2px 4px rgba(253,191,194,1);
      }
      .small-title {
        font-size: 14px;
        padding: 20px 0 0px;
      }
      .info {
        font-size: 72px;
        font-weight:500;
        color:rgba(252,70,54,1);
        line-height: 140px;
        text-shadow:0px 2px 2px rgba(252,106,106,1);
        background:linear-gradient(180deg, rgba(255,117,26,1) 0%, rgba(253,62,57,1) 100%);
        -webkit-background-clip:text;
        -webkit-text-fill-color:transparent;
      }
      .tip {
        margin-top: 10px;
        font-size: 12px;
        cursor: pointer;
      }
    }
  }
}
.mrl {
  margin-left: 10px;
}

.m-index-content {
  width: 100%;
  height: 100%;
  min-height: 600px;
  background: url(../assets/index_bg.png) no-repeat;
  .adv-c {
    position: relative;
    height: 120px;
    margin-bottom: 50px;
  }
  .adv-list {
    position: absolute;
    width: 100%;
    height:130px;
    top: -20px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    background: $color-white;
    box-shadow:0px 2px 2px 0px rgba(219,224,236,0.5);
    .adv-item {
      flex: 1;
      .item {
        width: 60%;
        margin: 0 auto;
        display: flex;
        align-items: center;
      }
      .icon {
        width: 76px;
        height: 76px;
      }
      .title {
        font-size: 14px;
      }
      p {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: pre-wrap;
        width: 120px;
        line-height: 18px;
      }
    }
  }
}
.products-area {
  position: relative;
  margin-bottom: 50px;
  height: 468px;
  display: flex;
  align-items: center;
  justify-content: center;
  .p-l {
    flex: 1;
    .p-l-c {
      width: 72%;
      margin: 0 auto;
      p {
        font-size: 16px;
        line-height: 50px;
      }
    }
    .title {
      font-size: 40px;
    }
    .more {
      width: 220px;
      margin-bottom: 60px;
      margin-top: 20px;
    }
    .tips {
      font-size: 14px;
      color: #626262;
      .tip {
        position: relative;
        &.icon-money::before {
          content: '';
          position: absolute;
          width: 16px;
          height: 16px;
          background: url(../assets/icon_money.png) no-repeat;
        }
        &.icon-msg::before {
          content: '';
          position: absolute;
          width: 16px;
          height: 16px;
          background: url(../assets/icon_msg.png) no-repeat;
        }
      }
    }
  }
  .p-r {
    flex: 3;
    height: 100%;
    background-color: $color-white;
    box-shadow:0px 2px 2px 0px rgba(219,224,236,0.5);
    .p-item {
      padding: 32px 0;
      border-bottom: 1px solid #E8E8E8;
      &:last-child {
        border-bottom: none;
      }
      & > p {
        font-size: 16px;
      }
      .info {
        margin-top: 16px;
        .info-i {
          display: inline-table;
          .info-msg {
            font-size: 34px;
            line-height: 28px;
          }
          .money {
            font-weight:500;
            color:rgba(245,47,62,1);
            background:linear-gradient(180deg, rgba(255,119,26,1) 0%, rgba(252,62,56,1) 100%);
            -webkit-background-clip:text;
            -webkit-text-fill-color:transparent;
          }
          .fonts {
            font-size: 16px;
          }
          .info-tip {
            color:#626262;
          }
          // 进度条
          .proce {
            width: 150px;
          }
        }
      }
    }
  }
}
.compony-list {
  position: relative;
  margin-bottom: 50px;
  .nav-title {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 40px;
  }
  .componys {
    display: flex;
    align-items: center;
    justify-content: center;
    .c-item {
      flex: 1;
      height:56px;
      & > div {
        width:213px;
        height: inherit;
        margin: 0 auto;
        img {
          width: auto !important;
        }
      }
    }
  }
}
</style>
